
import { viewer } from "./index"


function flyTo() {
    viewer.camera.flyTo({
        destination: Cesium.Cartesian3.fromDegrees(120, 30, 200000)
    })
}

function setView() {

    var homeCameraView = {
        longitude: 113.19852477692594,
        latitude: 21.987987831067873,
        height: 407.3694675811462,
        // height: 500,
        heading: 0.7212008920375688,
        pitch: -0.9589929846556138,
        roll: 0.00268109081661283
    };

    viewer.camera.setView({
        // fromDegrees()方法，将经纬度和高程转换为世界坐标
        destination: Cesium.Cartesian3.fromDegrees(homeCameraView.longitude, homeCameraView.latitude,
            homeCameraView.height),
        orientation: {
            // 方向
            heading: homeCameraView.heading,
            // 视角
            pitch: homeCameraView.pitch,
            // 倾斜角度
            roll: homeCameraView.roll
        }
    }
    );
}


export {
    flyTo,
    setView
}